import { setMd5Info, getHeardToken, getHeardXtoken } from '@/api/utils';

export const url: string = 'http://file.wuzhan.art/api/file'; 
let list = setMd5Info();  
export const heards: any = {         
  Authorization: getHeardToken(),   
  'x-access-token': getHeardXtoken(), // 请求头中携带token信息   
  ...list,   
};      
        
let loopUrl=''    
if (process.env.NODE_ENV === 'development') {        
  // 在开发环境下执行的代码       
  loopUrl ='https://wuzhan-1316349889.cos.ap-shanghai.myqcloud.com' ;//'http://t-file.jiyi.show';  
  // loopUrl = 'http://file.jiyi.show';  
} else {    
  loopUrl ='https://jiyi-1316349889.cos.ap-shanghai.myqcloud.com'; //'//file.jiyi.show'; 
  // 在其他环境下执行的代码
}  
export let urls: string =loopUrl; //正式环境'http://file.jiyi.show'; 


  
//判断url是否是完整的链接 
export const getLinkUrl = (url?: string, cancatUrl?: string) => {
  if (!url) {
    return '';
  }
  if (url.indexOf('https://') !== -1) {
    return url;
  } else {
    if (cancatUrl) {
      return urls + url + cancatUrl;
    } else {
      return urls + url;
    }
  }
  //
};

